<?php

namespace App\Http\Controllers\XhApi;


use App\Repository\Commit\DictConfigRepository;
use Illuminate\Http\Request;

class RegulationsController extends BaseController
{
    public $repoist;

    public function index(Request $request)
    {
        $type = $request->get('type');
        if (empty($type)) {
            $type = 'xhXhlc';
        }
        $RepoistDictConfig = new DictConfigRepository();
        $data = [];
        $rows = $RepoistDictConfig->getDataByKeys(['keys' => $type]);
        if (!empty($rows)) {
            $data['name'] = $rows[$type]['name'];
            $data['value'] = $RepoistDictConfig->setHtmlUploadPicHost($rows[$type]['value'], $request->getHost());
        }
        return $this->returnMsg(200, '数据已获取', $data);
    }
}
